package com.me.modules.publish.service.impl;

import com.me.modules.common.common.Constant;
import com.me.modules.common.page.Page;
import com.me.modules.common.page.PageHelper;
import com.me.modules.publish.dao.ReleaseInfoDao;
import com.me.modules.publish.entity.ReleaseInfoEntity;
import com.me.modules.publish.service.ReleaseInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service("releaseInfoService")
public class ReleaseInfoServiceImpl implements ReleaseInfoService {
    @Autowired
    private ReleaseInfoDao releaseInfoDao;

    @Override
    public ReleaseInfoEntity queryObject(Long id) {
        return releaseInfoDao.queryObject(id);
    }

    @Override
    public List<ReleaseInfoEntity> queryList(Map<String, Object> map) {
        return releaseInfoDao.queryList(map);
    }

    @Override
    public List<ReleaseInfoEntity> queryListByBean(ReleaseInfoEntity entity) {
        return releaseInfoDao.queryListByBean(entity);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return releaseInfoDao.queryTotal(map);
    }

    @Override
    public int save(ReleaseInfoEntity rlsReleaseInfo) {

        return releaseInfoDao.save(rlsReleaseInfo);
    }

    @Override
    public int update(ReleaseInfoEntity rlsReleaseInfo) {
        return releaseInfoDao.update(rlsReleaseInfo);
    }

    @Override
    public int delete(Long id) {
        return releaseInfoDao.delete(id);
    }

    @Override
    public int deleteBatch(Long[] ids) {
        return releaseInfoDao.deleteBatch(ids);
    }

    public Page<ReleaseInfoEntity> findPage(ReleaseInfoEntity releaseInfoEntity, int pageNum) {
        PageHelper.startPage(pageNum, Constant.pageSize);
        releaseInfoDao.queryList(releaseInfoEntity);
        return PageHelper.endPage();
    }
}
